const path = require('path')

const resolve = dir => path.join(__dirname, dir)

const BASE_URL = process.env.NODE_ENV === 'procution' ? '/iview-admin/' : '/'


module.exports = {
  lintOnSave: true,
  outputDir: 'dist', // 打包的目录
  baseUrl: BASE_URL,
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('_c', resolve('src/components'))
  },
  productionSourceMap: false,
  devServer: {
    open: true, // 启动服务后是否打开浏览器
    host: '0.0.0.0',
    port: 8082, // 服务端口
    // https: false,
    // hotOnly: false,
    proxy: 'http://localhost:8080'
  }
}
